package com.sq.partner.manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.ReportDao;
import com.sq.partner.manager.util.Page;

@Repository
public class ReportDaoImpl extends BaseDaoImpl implements ReportDao {
    /**
     * 按合作伙伴查询近十二个月有效保单数量
     */
    @Override
    public Page<Map<String,Object>> queryPolicyAmount(Page<Map<String, Object>> page)throws Exception {
        Integer i= (Integer) this.query("queryAmountNum", page.getMap());
        page.setTotal(i);
        List<Map<String,Object>> sales=(List<Map<String,Object>>)this.queryList("queryAmount", page.getMap());
        page.setData(sales);
        return page;
    }
    /**
     * 查询所有的合作伙伴
     */
    @Override
    public List<Map<String,Object>> queryAllPartner(Map<String,Object> paramMap)throws Exception {
        return this.queryList("queryAllPartner", paramMap);
    }
    /**
     * 查询所有的分公司
     */
    @Override
    public List<Map<String,Object>> queryAllDept(Map<String,Object> paramMap)throws Exception {
        return this.queryList("queryAllDept", paramMap);
    }
    /**
     * 根据合作伙伴按机构查询单量
     */
    @Override
    public List<Map<String,Object>> queryPartner(Map<String,Object> paramMap)throws Exception {
        return this.queryList("queryPartner", paramMap);
    }
    /**
     * 按合作伙伴下查询
     */
    @Override
    public List<Map<String,Object>> querypartnerAmount(Map<String,Object> paramMap)throws Exception {
        return (List<Map<String,Object>>)this.queryList("querypartnerAmount", paramMap);
    }
    /**
     * 按合作伙伴下查询机构数据
     */
    @Override
    public List<Map<String,Object>> queryDeptPartner(Map<String,Object> paramMap)throws Exception {
        return (List<Map<String,Object>>)this.queryList("queryDeptPartner", paramMap);
    }
    /**
     * 查询合作伙伴的投入成本
     */
    @Override
    public List<Map<String,Object>> queryChannelCost(Map<String,Object> paramMap)throws Exception {
        return (List<Map<String,Object>>)this.queryList("queryChannelCost", paramMap);
    }
    /**
     * 查询下载Excel数据
     */
    @Override
    public List<Map<String,Object>> queryReportFileData(Map<String,Object> paramMap)throws Exception {
        return this.queryList("queryReportFileData", paramMap);
    }
    
    /**
     * 查询合作伙伴名称和代码 lfd added 20190909
     */
    @Override
    public Page<Map<String,Object>> queryPartnerInfo(Page<Map<String, Object>> page)throws Exception {
        // return (List<Map<String,Object>>)this.queryList("queryPartnerInf", paramMap);
        Integer i= (Integer) this.query("queryPartnerInfCount", page.getMap());
        page.setTotal(i);
        List<Map<String,Object>> sales=(List<Map<String,Object>>)this.queryList("queryPartnerInf", page.getMap());
        page.setData(sales);
        return page;
    }
}

